package com.kefu.chat.vo;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.kefu.chat.model.ChatFaq;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractInsertVo;
import com.kefu.common.vo.AbstractUpdateVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;

@Data
public class ChatFaqUpdateVo extends AbstractUpdateVo<ChatFaq, String> {
    /**
     * 主键
     */
    @NotEmpty
    @ApiModelProperty(value = "主键")
    private String id;

    @ApiModelProperty(name = "faqName", value = "方案名称")
    private String faqName;
    @ApiModelProperty(value = "排序")
    private Integer sortNo;
    @ApiModelProperty(value = "状态")
    private Integer faqStatus;

    @ApiModelProperty(value = "描述")
    private String faqRemark;

    @ApiModelProperty(value = "超过个数分页")
    private Integer guidePageCount;

    @ApiModelProperty(value = "引导语")
    private String guideWord;

    @ApiModelProperty(value = "触发器，备用")
    private String triggerId;

    @ApiModelProperty(value = "渠道id")
    private String channelId;

    @ApiModelProperty(value = "展示形式1=问题列表，2=多分组问题，3=多业务")
    private Integer showType;

    @ApiModelProperty(value = "展示内容")
    private String showName;

    @ApiModelProperty(value = "展示")
    private String showContent;

    @Override
    public ChatFaq convert() {
        KefuContext context = KefuContext.getKefuContext();
        ChatFaq info = BeanUtil.toBean(this, ChatFaq.class);
        info.setUpdateTime(context.getNow());
        info.setUpdateUser(context.getUserId());
        info.setUpdateName(context.getUserName());
        return info;
    }
}
